package com.sduept.nwld.kpi.datasource;

import java.util.Comparator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.sduept.core.entity.IdentifiedObject;

/**
 * 数据对象描述
 *
 */
@Entity
@Table(name="t_kpi_KpiDataElement")
public class KpiDataElement extends IdentifiedObject implements Comparator<KpiDataElement>{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3203181364842248380L;
	/**
	 * Kpi ID
	 */
	@Column(length=24,nullable=false)
	private String pid;
	
	private String field;
	
	private boolean isIdKey;
	/**
	 * 字段的顺序
	 */
	private int fieldOrder;
	private String type;
	@Transient
	private String value;
	
	private boolean isNotNull;
	
	
	public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	public String getField() {
		return field;
	}
	public void setField(String field) {
		this.field = field;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public int getFieldOrder() {
		return fieldOrder;
	}
	public void setFieldOrder(int fieldOrder) {
		this.fieldOrder = fieldOrder;
	}
	public boolean isNotNull() {
		return isNotNull;
	}
	public void setNotNull(boolean isNotNull) {
		this.isNotNull = isNotNull;
	}
	public boolean isIdKey() {
		return isIdKey;
	}
	public void setIdKey(boolean isIdKey) {
		this.isIdKey = isIdKey;
	}
	@Override
	public int compare(KpiDataElement o1, KpiDataElement o2) {
		return o1.getFieldOrder() - o2.getFieldOrder();
	}
	
	

}
